{include file="common/header" /}

<div class="max-w-7xl mx-auto">
    <div class="bg-white rounded-lg shadow-lg p-6">
        <h3 class="text-2xl font-bold text-gray-800 mb-6">
            <i class="fa fa-list text-primary mr-2"></i> 我的报工记录
        </h3>
        
        <div class="overflow-x-auto">
            <table class="min-w-full divide-y divide-gray-200">
                <thead class="bg-gray-50">
                    <tr>
                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">报工时间</th>
                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">订单号</th>
                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">产品名称</th>
                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">型号名称</th>
                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">工序名称</th>
                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">报工数量</th>
                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">工价</th>
                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">工资金额</th>
                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">状态</th>
                    </tr>
                </thead>
                <tbody class="bg-white divide-y divide-gray-200">
                    {volist name="reports" id="report"}
                    <tr class="hover:bg-gray-50">
                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{$report.createtime|date='Y-m-d H:i',###}</td>
                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{$report.allocation.order.order_no|default='-'}</td>
                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{$report.allocation.model.product.name|default='-'}</td>
                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{$report.allocation.model.name|default='-'}</td>
                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{$report.allocation.process.name|default='-'}</td>
                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{$report.quantity}</td>
                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">¥{$report.allocation.price|default=0.00}</td>
                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">¥{$report.wage}</td>
                        <td class="px-6 py-4 whitespace-nowrap">
                            {if $report.status == 1}
                                <span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">已确认</span>
                            {else}
                                <span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-yellow-100 text-yellow-800">待确认</span>
                            {/if}
                        </td>
                    </tr>
                    {/volist}
                </tbody>
            </table>
        </div>
        
        {if condition="empty($reports)"}
        <div class="text-center py-12">
            <i class="fa fa-inbox fa-3x text-gray-300 mb-4"></i>
            <p class="text-gray-500">暂无报工记录</p>
        </div>
        {/if}
    </div>
</div>

{include file="common/footer" /}
